var express = require('express');
var router = express.Router();
var siteCtrl = require('./controllers/site');
var signCtrl = require('./controllers/sign');
var topicCtrl = require('./controllers/topic');
var replyCtrl = require('./controllers/reply');
var commonCtrl = require('./controllers/common');

//site controller
router.get('/', siteCtrl.index);
router.get('/tab/:tabId/:page?', siteCtrl.index);
router.get('/importDb', siteCtrl.importDb);

//sign controller
router.post('/signUp', signCtrl.signUp);
router.post('/login', signCtrl.login);
router.get('/logOut', signCtrl.logOut);

//topic controller
router.post('/topic/create', topicCtrl.create);
router.get('/topic/:tid/:page?', topicCtrl.index);

//reply controller
router.post('/reply/create', replyCtrl.create);

//common controller
router.get('/mentionedUsers/:tid?', commonCtrl.mentionedUsers);

module.exports = router;